package com.johann.designpattern.singleton;

public class LazyMan {
    private LazyMan(){}
    //先不创建
    private static LazyMan instance = null;
    public static LazyMan getInstance() {
        if (instance==null) {
            synchronized (LazyMan.class) {
                if (instance==null) {
                    instance = new LazyMan();
                }
            }
        }
        return instance;
    }
}
